<main>
    <?php
    $coordinatorID = $_SESSION['login_user'];
    $sql = "SELECT subjectName, description FROM subjects WHERE coordinatorID = '$coordinatorID'";
    $result = mysqli_query($db, $sql);
    $count = 0;
    while ($row = mysqli_fetch_assoc($result)) {
        addSubjectOption($row['subjectName'], $row['description']);
        $count = $count + 1;
    }
    if ($count == 0) {
        echo '<center><h1>You do not have any subjects assigned</h1></center>';
    }    


    function addSubjectOption($name, $description)
    {
        echo '<form action="/teacher/teacher.php" method="POST">' .
            "<p>" . $description . "</p>" .
            '<input type="submit" value="' . $name . '" name="subjectPanel"></form>';
    }
    ?>


</main>